package com.ship.contract.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.common.core.base.ContractBaseBean;
import com.ship.common.business.service.impl.BaseServiceImpl;
import com.ship.contract.service.ContractBaseService;

import java.util.List;

/**
 * @author tangshixuan
 * @date 2023-9-8
 */
public abstract class ContractBaseServiceImpl<M extends BaseMapper<T>, T extends ContractBaseBean> extends BaseServiceImpl<M, T> implements ContractBaseService<T> {

    @Override
    public List<T> allContracts(){
        return this.getBaseMapper().selectList(new QueryWrapper<>());
    }

    @Override
    public String getContractNameById(Long id){
        return this.getBaseMapper().selectById(id).getContractName();
    }

    @Override
    public String getContractNumberById(Long id){
        return this.getBaseMapper().selectById(id).getContractNumber();
    }


}
